//
//  HeroTWODemoVC.m
//  Demo
//
//  Created by lx on 2018/12/26.
//  Copyright © 2018 mgz. All rights reserved.
//

#import "HeroTWODemoVC.h"
#import <Hero.h>
#import <UIKit+Hero.h>
#import <Masonry.h>
@interface HeroTWODemoVC ()

@end

@implementation HeroTWODemoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
//    self.isHeroEnabled = YES;
    UIView *topView = [[UIView alloc]init];
    [self.view addSubview:topView];
    topView.heroID = @"top";
//    topView.heroModifiers = @[[HeroModifier zPosition:[NSNumber numberWithFloat:1]]];
    topView.heroModifiers = @[[HeroModifier fade]];
    topView.backgroundColor = [UIColor redColor];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(self.view).mas_offset(64);
        make.right.mas_equalTo(self.view).mas_offset(-64);
        make.height.mas_offset(200);

    }];
    
    UIView *bottomView = [[UIView alloc]init];
    [self.view addSubview:bottomView];
    bottomView.backgroundColor = [UIColor yellowColor];
    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(self.view);
        make.top.mas_equalTo(topView.mas_bottom);
        make.height.mas_offset(300);
    }];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dissmiss)];
    [topView addGestureRecognizer:tap];
    
    
    
}


- (void)dissmiss{
    
    [self ht_dismiss:nil];      
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
